package domain;
/*CREATE TABLE Product (
    ProductID INT AUTO_INCREMENT PRIMARY KEY, -- 商品编号，自增主键
    ProductName VARCHAR(255) NOT NULL, -- 商品名称，不允许为空
    Manufacturer VARCHAR(255) NOT NULL, -- 生产厂家，不允许为空
    ProductionDate DATE NOT NULL, -- 生产日期，不允许为空
    Model VARCHAR(255) NOT NULL, -- 型号，不允许为空
    PurchasePrice DECIMAL(10, 2) NOT NULL, -- 进货价，假设最多10位数字，其中2位是小数
    RetailPrice DECIMAL(10, 2) NOT NULL, -- 零售价格，假设最多10位数字，其中2位是小数
    Quantity INT NOT NULL -- 数量，不允许为空
);*/


import java.time.LocalDate;
import java.util.Date;

public class Product {
    private Integer ProductID;
    private String ProductName;
    private String Manufacturer;
    private Date ProductionDate;
    private String Model;
    private Double PurchasePrice;
    private Double RetailPrice ;
    private Integer Quantity;

    public Product(Integer productID, String productName, String manufacturer,
                   Date productionDate, String model, Double purchasePrice,
                   Double retailPrice, Integer quantity) {
        ProductID = productID;
        ProductName = productName;
        Manufacturer = manufacturer;
        ProductionDate = productionDate;
        Model = model;
        PurchasePrice = purchasePrice;
        RetailPrice = retailPrice;
        Quantity = quantity;
    }

    public Product() {}

    @Override
    public String toString() {

        return
                String.format("%-12s %-30s %-30s %-25s %-25s %-15s %-15s %-15s",
                        ProductID, ProductName, Manufacturer, ProductionDate,Model,
                        PurchasePrice, RetailPrice,  Quantity );
    }

    public Integer getProductID() {
        return ProductID;
    }

    public void setProductID(Integer productID) {
        ProductID = productID;
    }

    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String productName) {
        ProductName = productName;
    }

    public String getManufacturer() {
        return Manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        Manufacturer = manufacturer;
    }

    public Date getProductionDate() {
        return ProductionDate;
    }

    public void setProductionDate(Date productionDate) {
        ProductionDate = productionDate;
    }

    public String getModel() {
        return Model;
    }

    public void setModel(String model) {
        Model = model;
    }

    public Double getPurchasePrice() {
        return PurchasePrice;
    }

    public void setPurchasePrice(Double purchasePrice) {
        PurchasePrice = purchasePrice;
    }

    public Double getRetailPrice() {
        return RetailPrice;
    }

    public void setRetailPrice(Double retailPrice) {
        RetailPrice = retailPrice;
    }

    public Integer getQuantity() {
        return Quantity;
    }

    public void setQuantity(Integer quantity) {
        Quantity = quantity;
    }
}
